package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:04:41
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class ApplicationDomain implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id", com.ourteam.system.dao.ISysDomainDAO.Id);

        mappedDaoFields.put("code",
            com.ourteam.system.dao.ISysDomainDAO.DomainCode);

        mappedDaoFields.put("name",
            com.ourteam.system.dao.ISysDomainDAO.DomainName);

        mappedDaoFields.put("icon",
            com.ourteam.system.dao.ISysDomainDAO.DomainIcon);

        mappedDaoFields.put("title",
            com.ourteam.system.dao.ISysDomainDAO.DomainTitelKey);

        mappedDaoFields.put("sort",
            com.ourteam.system.dao.ISysDomainDAO.SortIndex);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysDomainDAO.Remarks);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysDomainDAO.Status);

        mappedDaoFields.put("shortName",
            com.ourteam.system.dao.ISysDomainDAO.DomainShortName);

        mappedDaoFields.put("smallIcon",
            com.ourteam.system.dao.ISysDomainDAO.DomainSmallIcon);

        mappedDaoFields.put("domainIconContent",
            com.ourteam.system.dao.ISysDomainDAO.DomainIconContent);

        mappedDaoFields.put("domainSmallIconContent",
            com.ourteam.system.dao.ISysDomainDAO.DomainSmallIconContent);
    }

    private com.ourteam.system.dao.SysDomain sysDomain;

    public ApplicationDomain() {
        super();

        this.sysDomain = new com.ourteam.system.dao.SysDomain();
    }

    public ApplicationDomain(com.ourteam.system.dao.SysDomain sysDomain) {
        super();

        this.sysDomain = sysDomain;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysDomain);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysDomain convertToSysDomain() {
        return this.sysDomain;
    }

    public com.ourteam.system.dao.SysDomain convertTo() {
        return this.sysDomain;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysDomain.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysDomain.setId(id);
    }

    /**
     * Get code
     *
     * @return String
     */
    public String getCode() {
        return (String) this.sysDomain.getDomainCode();
    }

    /**
     * Set code
     *
     * @parameter String
     */
    public void setCode(String code) {
        this.sysDomain.setDomainCode(code);
    }

    /**
     * Get name
     *
     * @return String
     */
    public String getName() {
        return (String) this.sysDomain.getDomainName();
    }

    /**
     * Set name
     *
     * @parameter String
     */
    public void setName(String name) {
        this.sysDomain.setDomainName(name);
    }

    /**
     * Get icon
     *
     * @return String
     */
    public String getIcon() {
        return (String) this.sysDomain.getDomainIcon();
    }

    /**
     * Set icon
     *
     * @parameter String
     */
    public void setIcon(String icon) {
        this.sysDomain.setDomainIcon(icon);
    }

    /**
     * Get title
     *
     * @return String
     */
    public String getTitle() {
        return (String) this.sysDomain.getDomainTitelKey();
    }

    /**
     * Set title
     *
     * @parameter String
     */
    public void setTitle(String title) {
        this.sysDomain.setDomainTitelKey(title);
    }

    /**
     * Get sort
     *
     * @return int
     */
    public int getSort() {
        return (int) this.sysDomain.getSortIndex();
    }

    /**
     * Set sort
     *
     * @parameter int
     */
    public void setSort(int sort) {
        this.sysDomain.setSortIndex(sort);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysDomain.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysDomain.setRemarks(remarks);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysDomain.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysDomain.setStatus(status);
    }

    /**
     * Get shortName
     *
     * @return String
     */
    public String getShortName() {
        return (String) this.sysDomain.getDomainShortName();
    }

    /**
     * Set shortName
     *
     * @parameter String
     */
    public void setShortName(String shortName) {
        this.sysDomain.setDomainShortName(shortName);
    }

    /**
     * Get smallIcon
     *
     * @return String
     */
    public String getSmallIcon() {
        return (String) this.sysDomain.getDomainSmallIcon();
    }

    /**
     * Set smallIcon
     *
     * @parameter String
     */
    public void setSmallIcon(String smallIcon) {
        this.sysDomain.setDomainSmallIcon(smallIcon);
    }

    /**
     * Get domainIconContent
     *
     * @return byte
     */
    public byte[] getDomainIconContent() {
        return (byte[]) this.sysDomain.getDomainIconContent();
    }

    /**
     * Set domainIconContent
     *
     * @parameter byte
     */
    public void setDomainIconContent(byte[] domainIconContent) {
        this.sysDomain.setDomainIconContent(domainIconContent);
    }

    /**
     * Get domainSmallIconContent
     *
     * @return byte
     */
    public byte[] getDomainSmallIconContent() {
        return (byte[]) this.sysDomain.getDomainSmallIconContent();
    }

    /**
     * Set domainSmallIconContent
     *
     * @parameter byte
     */
    public void setDomainSmallIconContent(byte[] domainSmallIconContent) {
        this.sysDomain.setDomainSmallIconContent(domainSmallIconContent);
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof ApplicationDomain) == false) {
            return false;
        } // end if

        ApplicationDomain other = (ApplicationDomain) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysDomain tempSysDomain = other.convertToSysDomain();

        if ((tempSysDomain == null) || (this.sysDomain == null)) {
            isEqual = false;
        } else if ((tempSysDomain == this.sysDomain) ||
                tempSysDomain.equals(this.sysDomain)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static ApplicationDomain[] toArray(
        com.ourteam.system.dao.SysDomain[] aSysDomains) {
        return toArray(aSysDomains, null);
    }

    public static ApplicationDomain[] toArray(
        com.ourteam.system.dao.SysDomain[] aSysDomains,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysDomains)) {
            return new ApplicationDomain[0];
        }

        int length = aSysDomains.length;

        ApplicationDomain[] beans = new ApplicationDomain[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new ApplicationDomain(aSysDomains[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i], new Object[] { aSysDomains[i] });
            }
        }

        return beans;
    }
}
